package com.example.a10928.weifriend.http.poll;

import io.reactivex.disposables.Disposable;

/**
 * Created by Chuang on 2018/4/4.
 * 请声明此类的作用，如无声明则留null
 */
public abstract class PollingRequest {
    //每个Subject的唯一标识
    protected String tag;

    //事件接口
    protected EventInterface eventInterface;

    //轮询动作
    protected PollingAction pollingAction;

    public PollingRequest(String tag, EventInterface eventInterface, PollingAction pollingAction) {
        this.tag = tag;
        this.eventInterface = eventInterface;
        this.pollingAction = pollingAction;
    }

    public abstract Disposable execute(PollingManager pollingManager);

    public String getTag() {
        return tag;
    }

    public EventInterface getEventInterface() {
        return eventInterface;
    }

    public interface PollingAction {
        void doAction(Object accept);
    }

}

